package com.sky.mapper.admin;


import com.sky.annotation.AutoFill;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.enumeration.OperationType;
import com.sky.pojo.Employee;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 员工管理数据层
 *
 * @Author: Zhy
 * @Date: 2025-01-14 14:57
 * @Version: 1.0
 */
public interface EmployeeMapper {

	/**
	 * 根据用户名查询员工
	 *
	 * @param: username
	 * @return:
	 */
	Employee getByUsername(String username);

	/**
	 * 添加员工
	 *
	 * @return:
	 * @param: employee 员工对象
	 */
	@AutoFill(OperationType.INSERT)
	void addEmployee(Employee employee);

	/**
	 * 分页查询员工信息
	 *
	 * @return:
	 * @param: employeePageQueryDTO 员工分页查询参数
	 */
	List<Employee> selectPageQuery(EmployeePageQueryDTO employeePageQueryDTO);

	/**
	 * 根据 id 查询员工信息
	 *
	 * @return:
	 * @param: id 员工id
	 */
	Employee getEmployeeById(@Param("id") Long id);

	/**
	 * 更新员工信息
	 *
	 * @return:
	 * @param:
	 */
	@AutoFill(OperationType.UPDATE)
	void updateEmployee(Employee employee);
}
